package com.blues.pattern.factory.simple;

import com.blues.pattern.factory.HuoTui;
import com.blues.pattern.factory.ChildrenHuoTui;
import com.blues.pattern.factory.SimpleHuoTui;

public class ShougongZuoFang {

   public HuoTui getHuoTuiByName(String name){
        if("经典火腿".equals(name)){
            return new SimpleHuoTui();
        }else if("儿童火腿".equals(name)){
            return new ChildrenHuoTui();
        }
        return  null;

    }
    HuoTui getHuoTuiByWeight(int weight){
        if(100==weight){
            return new SimpleHuoTui();
        }else if(10==weight){
            return new ChildrenHuoTui();
        }
        return null;
    }

}
